<!--#include file="Config.asp" -->
<!--#include file="HeadTop.asp"-->

<%

intID=int(Request("id"))
ActionType=request("ActionType")
SaveType=request("SaveType")
set rs=server.createobject("adodb.recordset")

'Add
if ActionType="Add" or ActionType="" then
AName="确定增加"
URL="?SaveType=AddOK"
end if

'Mod
if ActionType="Mod" and intID<>"" then
AName="确定修改"
sql="select * from Plan_Flag where ID="&Intid
rs.open sql,conn,1,1
title=trim(rs("title"))
bg_color=trim(rs("bg_color"))
IntID=int(rs("ID"))
rs.close
AID=intID
URL="?SaveType=ModOK&ID="&intID
end if

'SaveAdd
if SaveType="AddOK" and request("title")<>"" then
sql="select * from Plan_Flag where ID is null"
rs.open sql,conn,1,3
rs.addnew
rs("bg_color")=trim(Request("bg_color"))
rs("title")=trim(Request("title"))
rs.Update
rs.close
end if

'SaveMod
if SaveType="ModOK" and intID<>"" and request("title")<>"" then
sql="select * from Plan_Flag where ID="&IntID
rs.open sql,conn,1,3
rs("bg_color")=trim(Request("bg_color"))
rs("title")=trim(Request("title"))
rs.Update
title=trim(rs("title"))
bg_color=trim(rs("bg_color"))
AID=intID
URL="?SaveType=ModOK&ID="&intID
AName="确定修改"
rs.close

end if
%>

<%
'AnyPIM_Free_Right权限检测
If session("AnyPIM_RightAdmin")=1 then
%>
<!--添加  -->
<table class="table table-condensed table-bordered">
<form method="post" action="" name="form1">
<tr>
<td>
<A HREF="?ActionType=Add">[<U><FONT COLOR="#FF0000"><B>增加</B></FONT></U>]</A>
title
<input type="text" name="title" value="<%=title%>">
颜色
<input type="text" name="bg_color" value="<%=bg_color%>">
<span   style= "background:<%=bg_color%>">颜色样式</span>
<input type="submit" name="Submit" value="<%=aname%>">
</td>
</tr>
</form>
</table>
<%
End If
%>


<%
sql="select * from Plan_Flag order by ID"
rs.open sql,conn,1,1
%>
<table class="table table-condensed table-bordered">
	<tr class="info">
		<td>ID</td>
		<td>标题/点击修改</td>
		<td>底色</td>
	</tr>
<%
for r=1 to rs.recordcount
%>
<tr >
<TD><%=rs("ID")%></td>
<TD>
<%
'AnyPIM_Free_Right权限检测
If session("AnyPIM_RightAdmin")=1 then
%>
<A HREF="?ActionType=Mod&ID=<%=rs("ID")%>" title='点击修改' style= "background:<%=trim(rs("bg_color"))%>"><%=rs("title")%></A>
<%else%>
<%=rs("title")%>
<%End if%>
</td>
<TD bgcolor='<%=trim(rs("bg_color"))%>'><%=trim(rs("bg_color"))%></td>
</tr>
<%
rs.moveNext
next
rs.close
%>


</TABLE>

<!-- #include file="foot.asp" -->